Enable optimizations by default
authorAlex Crichton <alex@alexcrichton.com>
Wed, 7 Oct 2015 17:49:00 +0000 (10:49 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 7 Oct 2015 18:49:06 +0000 (11:49 -0700)
This change mirrors the compiler by enabling optimizations by default rather
than by default producing an unoptimized Cargo build. I was curious why #2033
hit a debug assertion when we don't ship any binaries with debug assertions
enabled, but it looked like Cargo was installed via Homebrew which [does not
currently enable optimizations][homebrew]. I'll also send a PR over there, but I
figured it'd be also good to nip this in the bud and just start enabling
optimizations by default.

[homebrew]: https://github.com/Homebrew/homebrew/blob/5d09dd/Library/Formula/rust.rb#L69

.travis.yml
Makefile.in
configure

index e21c9e18d48746ddce371290c25b1a448f25fa83..1cc9ac0e238d2ffb4c1fcbbf0790548f152e959e 100644 (file)
@@ -6,7 +6,7 @@ rust:
   - nightly
 sudo: false
 script:
-  - ./configure --prefix=$HOME/cargo-install --disable-cross-tests
+  - ./configure --prefix=$HOME/cargo-install --disable-cross-tests --disable-optimize
   - make
   - make test
   - make distcheck
index c42afa9bb056cff20d7d0ce3e7d86e8bdd8f5583..db8ccb65f30485f704e99e7fdc0b2c819ac5b6f7 100644 (file)
@@ -34,10 +34,10 @@ else
 MAYBE_DISABLE_VERIFY=
 endif
 
-ifdef CFG_ENABLE_OPTIMIZE
-OPT_FLAG=--release
-else
+ifdef CFG_DISABLE_OPTIMIZE
 OPT_FLAG=
+else
+OPT_FLAG=--release
 endif
 
 ifdef VERBOSE
index 5c2f8b3e235bcd1e3a79591661da42fd4ef7fcc6..c61a44b60172a46909c899718ab87ca312724acf 100755 (executable)
--- a/configure
+++ b/configure
@@ -293,7 +293,7 @@ BOOL_OPTIONS=""
 VAL_OPTIONS=""
 
 opt debug 1 "build with extra debug fun"
-opt optimize 0 "build with optimizations"
+opt optimize 1 "build with optimizations"
 opt nightly 0 "build nightly packages"
 opt verify-install 1 "verify installed binaries work"
 opt cross-tests 1 "run cross-compilation tests"